package info.zhou.tank;

import robocode.AdvancedRobot;

/**
 * 靶机坦克
 * Author: zhouinfo
 * Create Date：2016-05-11 23:03
 */
public class TargetTank extends AdvancedRobot {

    public static double PI = Math.PI;

    @Override
    public void run() {
        double width = getBattleFieldWidth();
        double height = getBattleFieldHeight();
        double x =getX();
        double y =getY();
        System.out.println(getHeading());
        System.out.println(x);
        System.out.println(y);
        double turn=(width / 2 - x) / (height / 2 - y);
        System.out.println(turn);
        System.out.println(Math.atan(turn));
        setTurnLeft(turn);
        //setAhead(Math.sqrt(Math.pow((width / 2 - x),2) + Math.pow((height / 2 - y),2)));
    }
}
